#ifndef  __LIBGUI_H__
#define  __LIBGUI_H__

#include <math.h>
#include <stdint.h>
#include <string.h>
#include "font.h"
#include "widget.h"



#define   BLACK     0x0000       //       
#define   WHITE     0xFFFF       //   
#define   RED       0xF800       //         
#define   BLUE      0x001F       //      
#define   GREEN     0x07E0       //            
#define   NAVY      0x000F       //      
#define   DGREEN    0x03E0       //    
#define   DCYAN     0x03EF       //     
#define   MAROON    0x7800       //         
#define   PURPLE    0x780F       //     
#define   OLIVE     0x7BE0       //         
#define   LGRAY     0xC618       //  
#define   DGRAY     0x7BEF       //        
#define   CYAN      0x07FF       //    
#define   MAGENTA   0xF81F       //      
#define   YELLOW    0xFFE0       //          
#define   GREY      LGRAY        //   

void LCD_Fill(int16_t xsta,int16_t ysta,int16_t xend,int16_t yend,uint16_t color);
void LCD_DrawPoint(struct window_t *window, int16_t x,int16_t y,uint16_t color);
void LCD_DrawLine(struct window_t *window, int16_t x1,int16_t y1,int16_t x2,int16_t y2,uint16_t color);
void LCD_DrawAngleLine(struct window_t *window, int16_t x,int16_t y,uint16_t Angle,uint16_t r,uint16_t color);
void LCD_DrawBLine(struct window_t *window, int16_t x1, int16_t y1, int16_t x2, int16_t y2,uint8_t size,uint16_t color);

void LCD_DrawMesh(struct window_t *window, int16_t x1, int16_t y1, int16_t x2, int16_t y2,uint16_t color);
void LCD_DrawRectangle(struct window_t *window, int16_t x1, int16_t y1, int16_t x2, int16_t y2,uint16_t color);
void LCD_DrawFillRectangle(struct window_t *window, int16_t x1, int16_t y1, int16_t x2, int16_t y2,uint16_t color);

void LCD_DrawCircle(struct window_t *window, int16_t x0,int16_t y0,uint16_t r,uint16_t color);
void LCD_DrawCircle2(struct window_t *window, int16_t x0,int16_t y0,uint16_t r,uint16_t color);
void LCD_DrawFillCircle(struct window_t *window, int16_t x0,int16_t y0,uint16_t r,uint16_t color);
void LCD_DrawFillCircle2(struct window_t *window, int16_t x0,int16_t y0,uint16_t r,uint16_t color);
void LCD_DrawArc1(struct window_t *window, int x,int y,int startAngle,int endAngle,uint16_t r,uint16_t c);

void LCD_DrawTriangle(struct window_t *window, int16_t x1,int16_t y1,int16_t x2,int16_t y2,int16_t x3,int16_t y3,uint16_t color);
void LCD_DrawFillTriangle(struct window_t *window, int16_t x1,int16_t y1,int16_t x2,int16_t y2,int16_t x3,int16_t y3,uint16_t color);

void LCD_DrawString(struct window_t *window, int16_t x, int16_t y, char *p, uint16_t fc, uint16_t bc,uint16_t alpha,const struct font_t *font);
void LCD_DrawChar(struct window_t *window, int16_t x,int16_t y,uint8_t word,uint16_t fc,uint16_t bc,uint16_t alpha,const struct font_t *font);

void LCD_DrawPicture(struct window_t *window, uint16_t x,uint16_t y,uint16_t length,uint16_t width, void const *);
void draw_pixel(uint16_t x,uint16_t y,uint16_t color);

#endif